//
//  HEDoctorSignCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/17.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEDoctorSignCell.h"

@interface HEDoctorSignCell ()

@property (nonatomic, strong) UIImageView *signImgView;

@end

@implementation HEDoctorSignCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    UIView *warp = [UIView new];
    warp.backgroundColor = CViewBgColor;
    [self.contentView addSubview:warp];

    [warp mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(0);
        make.left.equalTo(self.contentView).mas_offset(0);
        make.right.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView);
    }];
    
    _signImgView = [UIImageView new];
    _signImgView.image = IMAGE_NAMED(@"doctor_detail_sign");
    _signImgView.contentMode = UIViewContentModeScaleAspectFit;
    _signImgView.clipsToBounds = YES;
    [warp addSubview:_signImgView];
    
    _signImgView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toSignClick)];
    [_signImgView addGestureRecognizer:tap];
    
    [_signImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(warp).mas_offset(15);
        make.left.equalTo(warp).mas_offset(15);
        make.right.equalTo(warp).mas_offset(-15);
        make.height.mas_offset(80);
        make.bottom.equalTo(warp).mas_offset(-5);
    }];
}

- (void)refreshContent:(GDFiterCellModel *)fiterModel formModel:(GDFormModel *)formModel indexPath:(NSIndexPath *)indexPath {
    _delegate = formModel.proxyVC;
}

- (void)toSignClick {
    if ([_delegate respondsToSelector:@selector(toSignPage)]) {
        [_delegate toSignPage];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
